js中怎样循环实现<ul>下所有<li>标记的鼠标移动等动作触发发的事件?

来源:百度知道 编辑:UC知道 时间:2024/06/04 00:34:33
我已试过好多次,得出的结论是没法循环实现.
这样不行啊

你想要什么样的效果?
------------------------------------
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript>
<!--
function Transfer()
{
if(event.srcElement.tagName == "LI")
{
alert(event.srcElement.innerText + "-- Ok ,you can do your work at here!");
}
}

-->
</script>
</head>
<body onmousemove="Transfer()">
<UL>
<LI>this is the content of LI1</LI>
<LI>this is the content of LI2</LI>
</UL>
</body>
</html>

<html>
<head>
<title>jQuery ul li悬停</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"